//
//  LYEmailTableViewCell.m
//  SZBank
//
//  Created by LuoYao on 16/7/25.
//  Copyright © 2016年 LuoYao. All rights reserved.
//

#import "LYEmailTableViewCell.h"


@interface LYEmailTableViewCell ()
{
    CGFloat cwidth,cheight;
}
@end
@implementation LYEmailTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        cwidth = KWIDTH * 0.6 * 0.98;
        cheight = KHEIGHT * 0.6 * 0.08;
        
        //@"发信人",@"标题",@"状态",@"时间"
        
        [self addSubview:self.sendPersonLabel];
        [self addSubview:self.emailTitleLabel];
        [self addSubview:self.emailTypeLabel];
        [self addSubview:self.sendTimeLabel];
    }
    return self;
}

#pragma mark - getter
- (UILabel *)sendPersonLabel{
    if (!_sendPersonLabel) {
        _sendPersonLabel = ({
            UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(1, 0, cwidth / 4, cheight)];
            lb.textAlignment = NSTextAlignmentCenter;
            lb;
        });
    }
    return _sendPersonLabel;
}

- (UILabel *)emailTitleLabel{
    if (!_emailTitleLabel) {
        _emailTitleLabel = ({
            UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.sendPersonLabel.frame) + 1, 0, cwidth / 4, cheight)];
            lb.textAlignment = NSTextAlignmentCenter;
            lb;
        });
    }
    return _emailTitleLabel;
}

- (UILabel *)emailTypeLabel{
    if (!_emailTypeLabel) {
        _emailTypeLabel = ({
            UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.emailTitleLabel.frame) + 1, 0, cwidth / 4, cheight)];
            lb.textAlignment = NSTextAlignmentCenter;
            lb;
        });
    }
    return _emailTypeLabel;
}
- (UILabel *)sendTimeLabel{
    if (!_sendTimeLabel) {
        _sendTimeLabel = ({
            UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.emailTypeLabel.frame) + 1, 0, cwidth / 4, cheight)];
            lb.textAlignment = NSTextAlignmentCenter;
            lb;
        });
    }
    return _sendTimeLabel;
}
@end
